#ifndef GAMEKIT_DRAWING_H
#define GAMEKIT_DRAWING_H

#include "gamekit/gamekit.h"
#include "gamekit/common/SafePointer.h"

#include "Color.h"

namespace gamekit
{
	class Window;
	class Component;
	class Bitmap;

	class GK_API Canvas
	{
		friend class Scene;

	public:
		virtual ~Canvas();

		unsigned int zIndex(void) const;
		void setzIndex(const unsigned int& zIndex);

		bool visible(void) const;
		void setVisible(const bool& visible);

		int x(void) const;
		void setX(const int& x);

		int y(void) const;   
		void setY(const int& y);

		ushort width(void) const;
		
		ushort height(void) const;
		
		int bpp(void) const;

		void virtual resize(const uint& width, const uint& height) = 0;
		void virtual applyMask(SafePointer<Bitmap> mask) = 0;
		void virtual fill(const Color& color, const uint& x, const uint& y, const uint& w, const uint& h) = 0;
		void virtual draw(const SafePointer<Bitmap> bitmap, const int& x, const int& y);
		
		void virtual draw(const unsigned int& elapsed) = 0;
		void virtual init(const int& width, const int& height, const int& bpp);

	protected:
		Canvas(const int& x, const int& y, const uint& width, const uint& height, const uint& bpp, const uint& zIndex);
		Canvas(const int& x, const int& y, const SafePointer<Bitmap>& canvas, const uint& zIndex);

		void setWidth(const ushort& width);
		void setHeight(const ushort& heigth);

	private:
		uint m_zIndex;
		bool m_visible;
		int m_x;
		int m_y;
		ushort m_width;
		ushort m_height;
		ushort m_bpp;
	};
}

#endif
